All: cloud controller tools ui_server

CC := gcc
CXX := g++
TOPDIR := $(shell pwd)
CFLAGS += -I$(TOPDIR)/util
LDFLAGS += -laiot -lnopoll -lcJSON -lpthread -lrt
OUTPUT := $(TOPDIR)/output

ifeq ($(ARCH), arm)
	CXX := arm-linux-gnueabihf-g++
	CFLAGS += -I$(TOPDIR)/../LinkSDK/output/include
	LDFLAGS += -L$(TOPDIR)/../LinkSDK/output/lib
endif

export CC CXX CFLAGS LDFLAGS TOPDIR OUTPUT

.PHONY:cloud
cloud:
	make -C cloud

.PHONY:controller
controller:
	make -C controller

.PHONY:ui_server
ui_server:
	make -C ui_server

.PHONY:tools
tools:
	make -C tools

.PHONY:test
test:
	make -C test

clean:
	rm -rf $(OUTPUT)/*

